import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";
import GoodsDetail from "../views/GoodsDetail.vue";
import ShoppingCar from "@/views/ShoppingCar.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: HomeView,
  },
  {
    path: '/goods/:id',
    name: 'GoodsDetail',
    component: GoodsDetail,
    props: true
  },
   {
    path: '/shopping-car',
    name: 'ShoppingCar',
    component: ShoppingCar
  },
];

const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;
